# -*- coding: utf-8 -*-
#! /usr/bin/env python

import cloud, cmdNopass

HVM={ 'memory':'512','vcpu':'2','img':'/srv/cloud/iceblue/image/image_base/webPaaS_slave_base.img','count':1 }
ret=cloud.create_vm(HVM)
ip = ret[0][1]
print "waiting for master: %s to start ..." % ip
while True:
    sts, ret= cmdNopass.cmd('ping -c 1 -w 1 %s' % ip)
    if not sts:
        break
print "master: %s started!" % ip
